if (window.PrimeFaces) {
  /* Simplified Chinese (zh-CN) Language | Written by IKKI | 2021-12-25 */
  PrimeFaces.locales["zh"] = {
    startsWith: "以...开始",
    contains: "包含",
    notContains: "不包含",
    endsWith: "以...结尾",
    equals: "等于",
    notEquals: "不等于",
    noFilter: "无筛选",
    filter: "筛选",
    lt: "小于",
    lte: "小于等于",
    gt: "大于",
    gte: "大于等于",
    dateIs: "日期为",
    dateIsNot: "日期不为",
    dateBefore: "日期早于",
    dateAfter: "日期晚于",
    custom: "自定义",
    clear: "清除",
    apply: "应用",
    matchAll: "全部匹配",
    matchAny: "任意匹配",
    addRule: "添加规则",
    removeRule: "移除规则",
    accept: "是",
    reject: "否",
    choose: "选择",
    upload: "上传",
    cancel: "取消",
    completed: "已完成",
    pending: "待处理",
    dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
    dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
    dayNamesMin: ["日", "一", "二", "三", "四", "五", "六"],
    monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
    monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
    chooseYear: "选择年份",
    chooseMonth: "选择月份",
    chooseDate: "选择日期",
    prevDecade: "上一个十年",
    nextDecade: "下一个十年",
    prevYear: "上一年",
    nextYear: "下一年",
    prevMonth: "上个月",
    nextMonth: "下个月",
    prevHour: "上一小时",
    nextHour: "下一小时",
    prevMinute: "上一分钟",
    nextMinute: "下一分钟",
    prevSecond: "上一秒",
    nextSecond: "下一秒",
    am: "上午",
    pm: "下午",
    today: "今天",
    weekHeader: "周",
    firstDayOfWeek: 0,
    showMonthAfterYear: true,
    dateFormat: "yy/mm/dd",
    weak: "弱",
    medium: "中",
    strong: "强",
    passwordPrompt: "输入密码",
    emptyFilterMessage: "未找到结果",
    searchMessage: "有 {0} 条结果可用",
    selectionMessage: "已选择 {0} 项",
    emptySelectionMessage: "未选择任何项",
    emptySearchMessage: "未找到结果",
    emptyMessage: "无可用选项",
    aria: {
      trueLabel: "是",
      falseLabel: "否",
      nullLabel: "未选择",
      star: "1颗星",
      stars: "{star}颗星",
      selectAll: "已选择所有项目",
      unselectAll: "已取消选择所有项目",
      close: "关闭",
      previous: "上一个",
      next: "下一个",
      navigation: "导航",
      scrollTop: "滚动到顶部",
      moveTop: "移至顶部",
      moveUp: "上移",
      moveDown: "下移",
      moveBottom: "移至底部",
      moveToTarget: "移至目标",
      moveToSource: "移至源",
      moveAllToTarget: "全部移至目标",
      moveAllToSource: "全部移至源",
      pageLabel: "第 {page} 页",
      firstPageLabel: "首页",
      lastPageLabel: "尾页",
      nextPageLabel: "下一页",
      previousPageLabel: "上一页",
      rowsPerPageLabel: "每页行数",
      jumpToPageDropdownLabel: "跳至页面下拉框",
      jumpToPageInputLabel: "跳至页面输入框",
      selectRow: "选择行",
      unselectRow: "取消选择行",
      expandRow: "展开行",
      collapseRow: "折叠行",
      showFilterMenu: "显示筛选菜单",
      hideFilterMenu: "隐藏筛选菜单",
      filterOperator: "筛选运算符",
      filterConstraint: "筛选条件",
      editRow: "编辑行",
      saveEdit: "保存编辑",
      cancelEdit: "取消编辑",
      listView: "列表视图",
      gridView: "网格视图",
      slide: "滑动",
      slideNumber: "{slideNumber}",
      zoomImage: "放大图片",
      zoomIn: "放大",
      zoomOut: "缩小",
      rotateRight: "向右旋转",
      rotateLeft: "向左旋转",
    },
  };

// custom PF labels
  PrimeFaces.locales["zh"] = $.extend(true, {}, PrimeFaces.locales["zh"], {
    weekNumberTitle: "周",
    isRTL: false,
    yearSuffix: "",
    timeOnlyTitle: "仅时间",
    timeText: "时间",
    hourText: "时",
    minuteText: "分",
    secondText: "秒",
    millisecondText: "毫秒",
    year: "年",
    month: "月",
    week: "周",
    day: "日",
    list: "列表",
    allDayText: "全天",
    moreLinkText: "更多...",
    noEventsText: "无活动",
    aria: {
      "datatable.sort.ASC": "升序排列",
      "datatable.sort.DESC": "降序排列",
      "datatable.sort.NONE": "无序排列",
      "switch.ON": "开",
      "switch.OFF": "关",
      "messages.ERROR": "错误",
      "messages.FATAL": "严重错误",
      "messages.INFO": "信息",
      "messages.WARN": "警告",
    },
    messages: {
      // 客户端验证选项
      "javax.faces.component.UIInput.REQUIRED": "验证失败！“{0}”是必填项！",
      "javax.faces.converter.ByteConverter.BYTE": "{2}：“{0}”必须是字节型！",
      "javax.faces.converter.ByteConverter.BYTE_detail": "{2}：“{0}”必须是负2的7次方到2的7次方减1之间的整数！例如：{1}。",
      "javax.faces.converter.ShortConverter.SHORT": "{2}：“{0}”必须是短整型！",
      "javax.faces.converter.ShortConverter.SHORT_detail": "{2}：“{0}”必须是负2的15次方到2的15次方减1之间的整数！例如：{1}。",
      "javax.faces.converter.IntegerConverter.INTEGER": "{2}：“{0}”必须是整型！",
      "javax.faces.converter.IntegerConverter.INTEGER_detail": "{2}：“{0}”必须是负2的31次方到2的31次方减1之间的整数！例如：{1}。",
      "javax.faces.converter.LongConverter.LONG": "{2}：“{0}”必须是长整型！",
      "javax.faces.converter.LongConverter.LONG_detail": "{2}：“{0}”必须是负2的63次方到2的63次方减1之间的整数！例如：{1}。",
      "javax.faces.converter.FloatConverter.FLOAT": "{2}：“{0}”必须是单精度浮点型！",
      "javax.faces.converter.FloatConverter.FLOAT_detail": "{2}：“{0}”必须是1.4E-45到3.4028235E38之间的浮点数！例如：{1}。",
      "javax.faces.converter.DoubleConverter.DOUBLE": "{2}：“{0}”必须是双精度浮点型！",
      "javax.faces.converter.DoubleConverter.DOUBLE_detail": "{2}：“{0}”必须是4.9E-324到1.7976931348623157E308之间的浮点数！例如：{1}。",
      "javax.faces.converter.BooleanConverter.BOOLEAN": "{1}：“{0}”必须是布尔型！",
      "javax.faces.converter.BooleanConverter.BOOLEAN_detail": "{1}：“{0}”必须是“true”或者“false”！“true”以外的任何值都将被视为“false”。",
      "javax.faces.converter.CharacterConverter.CHARACTER": "{1}：“{0}”必须是字符型！",
      "javax.faces.converter.CharacterConverter.CHARACTER_detail": "{1}：“{0}”必须是一个有效的ASCII字符。",
      "javax.faces.converter.BigIntegerConverter.BIGINTEGER": "{2}：“{0}”必须是大整数型！",
      "javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail": "{2}：“{0}”必须是不可变的任意精度的整数！例如：{1}。",
      "javax.faces.converter.BigDecimalConverter.DECIMAL": "{2}：“{0}”必须是大浮点数型！",
      "javax.faces.converter.BigDecimalConverter.DECIMAL_detail": "{2}：“{0}”必须是不可变的有符号的任意精度的浮点数！后面可能跟小数点和分数。例如：{1}。",
      "javax.faces.validator.LongRangeValidator.MAXIMUM": "{1}：验证失败！值大于允许的最大值“{0}”。",
      "javax.faces.validator.LongRangeValidator.MINIMUM": "{1}：验证失败！值小于允许的最小值“{0}”。",
      "javax.faces.validator.LongRangeValidator.NOT_IN_RANGE": "{2}：验证失败！值不在“{0}”和“{1}”之间。",
      "javax.faces.validator.LongRangeValidator.TYPE": "{0}: 验证失败！值的类型不正确。",
      "javax.faces.validator.DoubleRangeValidator.MAXIMUM": "{1}：验证失败！值大于允许的最大值“{0}”。",
      "javax.faces.validator.DoubleRangeValidator.MINIMUM": "{1}：验证失败！值小于允许的最小值“{0}”。",
      "javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE": "{2}：验证失败！值不在“{0}和“{1}”之间。",
      "javax.faces.validator.DoubleRangeValidator.TYPE": "{0}: 验证失败！值的类型不正确。",
      "javax.faces.converter.DateTimeConverter.DATE": "{2}：“{0}”必须是日期型！",
      "javax.faces.converter.DateTimeConverter.DATE_detail": "{2}：“{0}”必须是有效的日期数据类型！例如：{1}。",
      "javax.faces.converter.DateTimeConverter.TIME": "{2}：“{0}”必须是时间型！",
      "javax.faces.converter.DateTimeConverter.TIME_detail": "{2}：“{0}”必须是有效的时间数据类型！例如：{1}。",
      "javax.faces.converter.DateTimeConverter.DATETIME": "{2}：“{0}”必须是日期时间型！",
      "javax.faces.converter.DateTimeConverter.DATETIME_detail": "{2}：“{0}”必须是有效的日期时间数据类型！例如：{1}。",
      "javax.faces.converter.DateTimeConverter.PATTERN_TYPE": "{1}：必须指定“格式”或“类型”属性才能转换“{0}”。",
      "javax.faces.converter.NumberConverter.NUMBER": "{2}：“{0}”必须是数字型！",
      "javax.faces.converter.NumberConverter.NUMBER_detail": "{2}：“{0}”必须是有效的数字数据类型！例如：{1}.",
      "javax.faces.converter.NumberConverter.PERCENT": "{2}：“{0}”必须是百分比型！",
      "javax.faces.converter.NumberConverter.PERCENT_detail": "{2}：“{0}”必须是有效的百分比数据类型！例如：{1}.",
      "javax.faces.converter.NumberConverter.CURRENCY": "{2}：“{0}”必须是货币值型！",
      "javax.faces.converter.NumberConverter.CURRENCY_detail": "{2}：“{0}”必须是有效的货币值数据类型！例如：{1}.",
      "javax.faces.converter.NumberConverter.PATTERN": "{2}：“{0}”必须是数字格式！",
      "javax.faces.converter.NumberConverter.PATTERN_detail": "{2}：“{0}”必须是有效的数字格式数据类型！例如：{1}.",
      "javax.faces.validator.LengthValidator.MAXIMUM": "{1}：验证失败！长度大于允许的最大值“{0}”。",
      "javax.faces.validator.LengthValidator.MINIMUM": "{1}：验证失败！长度小于允许的最小值“{0}”。",
      "javax.faces.validator.RegexValidator.PATTERN_NOT_SET": "必须设置正则表达式格式！",
      "javax.faces.validator.RegexValidator.PATTERN_NOT_SET_detail": "正则表达式格式必须设置为非空值！",
      "javax.faces.validator.RegexValidator.NOT_MATCHED": "正则表达式格式不匹配！",
      "javax.faces.validator.RegexValidator.NOT_MATCHED_detail": "“{0}”的正则表达式格式不匹配！",
      "javax.faces.validator.RegexValidator.MATCH_EXCEPTION": "正则表达式错误！",
      "javax.faces.validator.RegexValidator.MATCH_EXCEPTION_detail": "“{0}”的正则表达式错误！",
      // 集成在客户端验证中的参数验证选项
      "javax.faces.validator.BeanValidator.MESSAGE": "{0}",
      "javax.validation.constraints.AssertFalse.message": "必须是“false”！",
      "javax.validation.constraints.AssertTrue.message": "必须是“true”！",
      "javax.validation.constraints.DecimalMax.message": "必须小于或等于“{0}”！",
      "javax.validation.constraints.DecimalMin.message": "必须大于或等于“{0}”！",
      "javax.validation.constraints.Digits.message": "数值越界“{0}”位！只允许“{1}”位！",
      "javax.validation.constraints.Past.message": "必须是过去时间！",
      "javax.validation.constraints.Future.message": "必须是未来时间！",
      "javax.validation.constraints.Max.message": "必须小于或等于“{0}”！",
      "javax.validation.constraints.Min.message": "必须大于或等于“{0}”！",
      "javax.validation.constraints.NotNull.message": "不能为“null”！",
      "javax.validation.constraints.Null.message": "必须是“null”！",
      "javax.validation.constraints.Pattern.message": "必须匹配“{0}”！",
      "javax.validation.constraints.Size.message": "大小必须介于“{0}”和“{1}”之间！",
    },
  });
  PrimeFaces.locales["zh_CN"] = PrimeFaces.locales["zh"];

  /* Traditional Chinese (zh_TW) */
  PrimeFaces.locales["zh_TW"] = $.extend(true, {}, PrimeFaces.locales["zh"], {
    startsWith: "以...開始",
    contains: "包含",
    notContains: "不包含",
    endsWith: "以...結束",
    equals: "等於",
    notEquals: "不等於",
    noFilter: "不篩選",
    filter: "篩選",
    lt: "小於",
    lte: "小於或等於",
    gt: "大於",
    gte: "大於或等於",
    dateIs: "日期為",
    dateIsNot: "日期不為",
    dateBefore: "日期早於",
    dateAfter: "日期晚於",
    custom: "自訂義",
    clear: "清除",
    apply: "應用",
    matchAll: "全部匹配",
    matchAny: "任意匹配",
    addRule: "增加規則",
    removeRule: "移除規則",
    accept: "是",
    reject: "否",
    choose: "選擇",
    upload: "上傳",
    cancel: "取消",
    completed: "已完成",
    pending: "待定",
    fileSizeTypes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
    dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
    dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
    dayNamesMin: ["日", "一", "二", "三", "四", "五", "六"],
    monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
    monthNamesShort: ["1 月", "2 月", "3 月", "4 月", "5 月", "6 月", "7 月", "8 月", "9 月", "10 月", "11 月", "12 月"],
    chooseYear: "選擇年份",
    chooseMonth: "選擇月份",
    chooseDate: "選擇日期",
    prevDecade: "上一個十年",
    nextDecade: "下一個十年",
    prevYear: "上一年",
    nextYear: "下一年",
    prevMonth: "上一個月",
    nextMonth: "下一個月",
    prevHour: "上一個小時",
    nextHour: "下一個小時",
    prevMinute: "上一分鐘",
    nextMinute: "下一分鐘",
    prevSecond: "上一秒",
    nextSecond: "下一秒",
    am: "上午",
    pm: "下午",
    today: "今日",
    now: "現在",
    weekHeader: "周",
    firstDayOfWeek: 0,
    showMonthAfterYear: true,
    dateFormat: "yy/mm/dd",
    weak: "弱",
    medium: "中",
    strong: "強",
    passwordPrompt: "輸入一組密碼",
    emptyFilterMessage: "無相關篩選結果",
    searchMessage: "{0} 個相關結果",
    selectionMessage: "{0} 個項目被選取",
    emptySelectionMessage: "無選取項目",
    emptySearchMessage: "無相關搜尋結果",
    emptyMessage: "無可用選項",
    aria: {
      trueLabel: "是",
      falseLabel: "否",
      nullLabel: "未選擇",
      star: "1 顆星",
      stars: "{star} 顆星",
      selectAll: "已選取所有項目",
      unselectAll: "已取消選取所有項目",
      close: "關閉",
      previous: "上一個",
      next: "下一個",
      navigation: "轉導",
      scrollTop: "滾動至頂端",
      moveTop: "移動至頂端",
      moveUp: "往上移動",
      moveDown: "往下移動",
      moveBottom: "移動至底端",
      moveToTarget: "移動至目標",
      moveToSource: "移動至來源",
      moveAllToTarget: "全部移動至目標",
      moveAllToSource: "全部移動至來源",
      pageLabel: "{page}",
      firstPageLabel: "第一頁",
      lastPageLabel: "最後一頁",
      nextPageLabel: "下一頁",
      previousPageLabel: "上一頁",
      rowsPerPageLabel: "每頁行數",
      jumpToPageDropdownLabel: "跳至頁面下拉選單",
      jumpToPageInputLabel: "跳至頁面輸入欄位",
      selectRow: "選取行",
      unselectRow: "取消選取行",
      expandRow: "展開行",
      collapseRow: "收闔行",
      showFilterMenu: "展示篩選選單",
      hideFilterMenu: "隱藏篩選選單",
      filterOperator: "篩選運算子",
      filterConstraint: "篩選條件",
      editRow: "編輯行",
      saveEdit: "儲存編輯",
      cancelEdit: "取消編輯",
      listView: "列表視圖",
      gridView: "網格視圖",
      slide: "滑動",
      slideNumber: "{slideNumber}",
      zoomImage: "放大圖片",
      zoomIn: "放大",
      zoomOut: "縮小",
      rotateRight: "向右旋轉",
      rotateLeft: "向左旋轉",
    },
  });
}